class PopulateDatabase < ActiveRecord::Migration
    def self.up
        # Article table
        #  name        :string(255)
        #  description :text
        #  price       :decimal(8, 2)   default(0.0)
        #  created_at  :datetime
        #  updated_at  :datetime
        #  image_url   :string(255)
        
        article1 = Article.create({
          :name => "Classical Guitar", 
          :price => 180.00, 
          :image_url => '/images/classical_guitar.jpg', 
          :description => "A fine quality, classical guitar made for beginners who nevertheless demand a certain level of sound quality, no matter what their skill level.  This unit represents an excellent balance between quality and price.",
          :category_id => 2 
          })

        
        article2 = Article.create({
          :name => "Gene Simmons War Axe Guitar",
          :price => 400.00,
          :image_url => '/images/gene-simmons-axe-guitar.jpg',
          :description => "This fine specimen of a musical instrument was conceived by rock legend Gene Simmons of the band KISS.  He was the guy with the long tongue.  We're still not sure if that made women scared or horny, but no matter, he's dead now.  Oh wait, no he isn't.  He's still trying in vain to sleep with young women who just complains he smells like cheese.  This guitar is well suited for being a Rock God playing Guitar Hero for PS3.",
          :category_id => 3
        })
       
        article3 = Article.create({
          :name => "Platinum Beast",
          :price => 999.99,
          :image_url => '/images/platinum-beast-guitar-black.jpg',
          :description => "This item was conceived, designed, and produced in Norway and has been our top selling item in that region.  From the youngest metalhead to the oldest of grannies, nothing has been able to get in the way of this guitar's success, except perhaps for the air guitar, something we are unfortunately unable to offer at this time.",
          :category_id => 3
        })
        
        article4 = Article.create({
          :name => "Keytar",
          :price => 380.00,
          :image_url => '/images/keytar.jpg',
          :description => "Where would 80's music be without this gem?  In a rare re-issue of a true classic, we are pleased to offer the Keytar at an introductory low price.",
          :category_id => 4
        })
    
      
        
        article5 = Article.create({
          :name => "Der Alleskönner",
          :price => 1450.00,
          :image_url => '/images/quad_guitar_front2.jpg',
          :description => "Never be late to your own concert again.  This one guitar fits all is really the last guitar you will ever buy.  Not because it will do everything for you, but because it weighs 42kg.  Barry Gibb of the Bee Gees picked one up, tried it on, then had to cancel his world tour due to severe back pain.  It is recommended to play this guitar sitting down, or with a friend to help you carry it.",
          :category_id => 4
        })

      end

      def self.down

        @articles = Article.all
        @articles.each do |article|
          article.destroy
        end
      end
  end